READ ME:

2017-01-27

The tool will fail if you try to assign a document that has never been previously assigned.

To remedy that:
1. Find your QdabraSamples database, usually named QdabraSamples or QdabraUtillity
2. Run the following SQL Script to update the QdFlowLatestWithMetaData view to return a HostDocID, even if the document in question had not previously been assigned.

	Alter VIEW [dbo].[QdFlowLatestWithMetaData]
	AS
	SELECT
	COALESCE(QFL.HostDocID,D.DocID) as HostDocID,
	(SELECT [Name] FROM [QdabraDBXL].dbo.QdDocumentType AS DT WHERE (ID = D.Type)) AS DocTypeName,
	D.Type AS TypeId,
	D.[Name],
	D.Author,
	Cast(D.Description as nvarchar(4000)) as Description,
	CASE
	WHEN (D.IsLocked = 1) AND (D.LockExpires >= GETDATE()) THEN
	CAST(1 as bit)
	ELSE
	CAST(0 as bit)
	END As IsLocked,
	COALESCE(QFL.AssignedToAlias, N'__UNDEFINED__') as AssignedToAlias,
	COALESCE(QFL.AssignedToName, N'__UNDEFINED__') as AssignedToName,
	COALESCE(QFL.Status, N'__UNDEFINED__') as Status,
	QFL.Date,
	QFL.[Time],
	COALESCE(QFL.ModifiedByAlias, N'__UNDEFINED__') as ModifiedByAlias,
	COALESCE(QFL.ModifiedByName, N'__UNDEFINED__') as ModifiedByName,
	COALESCE(QFL.Comment, N'__UNDEFINED__') as Comment, 
	D.DocID as OrigDoc
	FROM [QdabraDBXL].dbo.[Document] AS D  LEFT OUTER JOIN
	dbo.QdFlowLatest AS QFL ON QFL.HostDocID = D.DocID

	GO

If you need assistance, contact Qdabra Support at support@qdabra.com
